The operation of computer display systems may be modeled in terms of an "ideal" image and a "displayed image." Such a model assumes that the ideal image is composed of ideal, infinite-precision color values at each pixel location. The display hardware serves to approximate these ideal color values, within the limits of the system hardware, to generate the displayed image. The display hardware can thus be conceptualized as a transfer function between the ideal pixel color and the displayed pixel color. In an RGB display system, this transfer function can be thought of as three separate transfer functions, each operating on one of the color components (red, green, or blue) comprising each pixel.
Displayed images are typically generated by writing pixel data to a display memory. The data in the "on-screen" portion of the display memory is then periodically read, in a serial pixel-by-pixel fashion, to display hardware. This process is referred to as screen refresh. The display hardware converts digital pixel information into analog display control information, usually by operation of a digital-to-analog converter (DAC). As a result, one inherent constraint on color variation in the display hardware is the resolution of the DAC. For example, a 24-bit DAC (typically three, 8-bit DACs) can generate 2.sup.24 distinct colors on the display screen.
A second constraint is the size of the pixel data (pixel depth or bits per pixel). The prior art includes two approaches to storing pixel data, direct color systems and indexed color systems. Direct color systems essentially quantize the ideal color to fixed precision based on the pixel depth. For 24-bit direct color systems, each color component of the pixel (red, green or blue) is quantized to 8 bits (256 discrete levels). This precision is generally considered to be sufficient to be indistinguishable to the eye from an ideal image. For 15-bit direct color systems, each color component is quantized to 5 bits. As the pixel depth decreases, more pixels are mapped to identical color values, resulting in undesirable artifacts such as "posterization", particularly when the ideal image depicts smoothly varying color intensity levels.
In an indexed color system, a set of color values are stored in a color look-up table (CLUT or palette), and software maps ideal colors to the nearest available CLUT color value. The advantage provided by indexed color systems is that the color output values are programmable. Thus, in the case of the above system, a set of 256 colors, selected from any of the 16.7 million possible colors can be loaded into the CLUT. For many images, judicious selection of the CLUT values in an 8 bpp indexed color mode can provide richer displays than a 16 bpp direct color mode.
Prior art display systems have typically addressed either continuous-tone images, such as scanned photographs, or discrete-tone images, such as text and chart displays. Continuous-tone images have been represented by 24-bit direct color; discrete-tone images have been represented using 4-bit or 8-bit indexed color systems.
Currently, in computer visualization, modeling, and gaming applications, the ability to display "rendered" images has become increasingly important. Rendered images generally involve smooth gradations of color, as they are attempts to simulate real world continuous-tone objects. In a scene, each object is typically rendered pixel-by-pixel by starting with two inputs: the color of the pixel, assuming canonical lighting conditions (i.e. fully lit, no specular reflection) and a parameter describing the actual lighting conditions at the object's position within the scene. The portion of the system rendering the pixel color can be considered a "color engine." The portion of the system describing the actual lighting conditions can be considered a "shading" engine.
A block diagram illustrating a prior art direct color rendering system is set forth in FIG. 1. The system of FIG. 1 is designated by the general reference character 10, and includes a screen update section 12 and a screen refresh section 14. Due to the animation requirements typically involved in generating rendered images, the system is "double buffered" and so the screen update section 12 includes a back buffer 16, and the screen refresh section 14 includes a front buffer 18. The back buffer 16 receives screen update information, and, when a frame render is complete, it is swapped with the front buffer 18. The data in the new front buffer is then read into display hardware. Double buffering is well understood in the art, and so will not be discussed further herein.
The screen update section 12 includes a color engine 20, a shading engine 22, a multiplier circuit 24, and the back buffer 16. A screen refresh section 14 includes the front buffer 18 and a DAC 26. The color engine 20 provides a color pixel (shown as CR, CG, CB, representing the red value, green value and blue value, respectively, of the color pixel). Concurrently, the shading engine 22 provides a lighting modulation value corresponding to the color pixel. (The lighting modulation value is shown as LR, LG and LB, which represent shading to apply to CR, CG and CB values, respectively). Each color value is modulated by its corresponding lighting value in the multiplier circuit 24. The multiplier circuit 24 generates a red, green and blue value (shown as R, G, and B) which together represent a lighting modulated direct color pixel (shown as RGB). This value is written into the back buffer 16 of the display memory.
A drawback of the direct color rendering system set forth in FIG. 1, is that an increase in colors or shading precision requires greater pixel depths, and as a result, an increase in overall display memory size.
A block diagram illustrating a prior art indexed color rendering system is set forth in FIG. 2. The system is represented by the general reference character 30 and is shown to include a screen update portion 32 and a screen refresh portion 34. The screen update portion 32 includes a color engine 36, a shading engine 22, an index-to-direct look-up table (CLUT) 38, a multiplier circuit 24, and a back buffer 40. Unlike the direct color system 10, the color engine 36 of the indexed system provides an indexed pixel value (shown as CLUT8). This value is input to the CLUT 38 which generates a corresponding RGB pixel value (shown as CR, CG and CB). As in the direct color system, the shading engine generates corresponding lighting modulation values (LR, LG, LB), which operate on their corresponding CR, CG, and CB component in the multiplier circuit 24 to generate a direct color value pixel (RGB). This value is written to the back buffer 40. The screen refresh portion 34 reads data from a front buffer 42 to a DAC 26.
A drawback of the indexed color system is that the displayed images degrade considerably when displayed with indexed color systems, due to the limited number of colors available in the palette. Further, in the indexed color system the CLUT 38 must typically be realized as a high speed RAM with 2.sup.bpp entries (where bpp is bits per pixel). Accordingly, a larger size CLUT requires more area on an integrated circuit.
It is known in the prior art to simplify the lighting modulation operation by having the shading engine generate only white light modulation values. In such a case, the same lighting modulation value (L) is applied to all three color components of the color pixel (i.e., L=LR=LG=LB).
While prior art approaches have efficiently handled non-rendered data, which employ direct color or indexed color without shading or other effects, they have not optimally processed rendered data to obtain the greatest resolution and color quality with the least memory usage.